/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mlbsclient;

import com.mlbs.entity.Usertable;
import com.mlbs.session.generated.UsertableFacadeRemote;
import java.util.Date;
import javax.ejb.EJB;

/**
 *
 * @author mckd87, hitesh
 */
public class Main {
    @EJB
    private static UsertableFacadeRemote usertableFacade;
    
   private String [] firstNames = {
        "Adam",
        "John",
        "Sam",
        "Kevin",
        "Sankate",
        "Hitesh"
    };
    
    private String [] lastNames = {
        "Smith",
        "Carter",
        "Russel",
        "Bush",
        "Obama",
        "Clinton"
    };

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Main main = new Main();
        main.createUser();
    }

    private void createUser() {
        Usertable usertable = new Usertable();
        int seedValue = (int)System.currentTimeMillis();
        for(int i=0; i<firstNames.length;i++){
            for(int j=0; j<lastNames.length;j++){
                System.out.println("seedValue--------------------");
                System.out.println(seedValue);
                usertable = new Usertable(new Integer(seedValue++));
                usertable.setFirstName(firstNames[i]);
                usertable.setLastName(lastNames[j]);
                usertable.setEmailid(firstNames[i]+lastNames[j]+seedValue+"@gmail.com");
                usertable.setDateCreated(new Date(System.currentTimeMillis()));
                usertable.setActive('T');
                usertable.setChallengeAnswer(firstNames[i]+lastNames[j]+"@gmail.com");
                usertable.setChallengeId(null);
                usertable.setDateModified(new Date());
                usertable.setDisplayName(firstNames[i] + " " +lastNames[j]);
                usertable.setOptionFlags(i);
                usertable.setSubscriptionID(String.valueOf(seedValue));
                System.out.println("seedValue--------------------OUT");
                System.out.println(seedValue);
                usertableFacade.create(usertable);        
            }
        }
        
    }

}
